package cn.ggy.dao;

import cn.ggy.polo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class StuImpl implements StuDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    public List<Student> getStu() {
        String sql = "select * from student";
        return jdbcTemplate.query(sql,new BeanPropertyRowMapper<Student>(Student.class));
    }
}
